# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-nest-asyncio
pkgver=1.5.8
pkgrel=1
pkgdesc="Patch asyncio to allow nested event loops"
url="https://github.com/erdewit/nest_asyncio"
license=('BSD')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
provides=('python-nest_asyncio')
replaces=('python-nest_asyncio')
source=("https://github.com/erdewit/nest_asyncio/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('845900760e50fa0d1aee75f93707dfbbf14044805e1cae53beff42091cbd6855ad134bcfa0130b4b422208270a49efeea415d0c2a7597d37019868c929102f2e')

build() {
  cd nest_asyncio-$pkgver
  python setup.py build
}

check() {
  cd nest_asyncio-$pkgver
  PYTHONPATH="$PWD/build/lib" python tests/nest_test.py
}

package() {
  cd nest_asyncio-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
